import request from "@/utils/request.js";
import api from "@/api/index.js";

export const reqAllMenuTree = () => {
    return request({
        url: api.reqAllMenuTreeURL,
        method: 'GET'
    })
}

export const reqMenuByMenuType = (menuType) => {
    return request({
        url: api.reqMenuByMenuTypeURL + `/${menuType}`,
        method: 'GET'
    })
}

export const reqAddMenu = (menuModel) => {
    return request({
        url: api.reqAddMenuURL,
        method: 'POST',
        data: menuModel
    })
}
export const reqUpdateMenu = (menuModel) => {
    return request({
        url: api.reqAddMenuURL,
        method: 'PUT',
        data: menuModel
    })
}

export const reqRemoveBatchMenu = (ids) => {
    return request({
        url: api.reqRemoveBatchMenuURL,
        method: 'DELETE',
        data: ids
    })
}

export const reqMenuIdByRoleId = (roleId) => {
    return request({
        url: api.reqFullCheckMenuIdByRoleIdURL + `/${roleId}`,
        method: 'GET'
    })
}
